<?php
/**
 * This file is part of the Agora distribution. 
 * Detailed copyright and licensing information can be found
 * in the gpl-3.0.txt file which should be included in the distribution.
 * 
 * @version		$Id: 3.0.14 Olympus 2010-09-28 rammstein4o $
 * @copyright  2007 - 2010 jVitals
 * @license   GPLv3 Open Source
 * @link       http://jvitals.com
 * @since      File available since initial release
 */
    defined ('IN_AGORA') or die;

	require_once ('view.php');

	class MarkerView extends View
	{
		var $_users;

		function __construct()
		{
			$_user = null;
		}

		function display()
		{
//			ob_end_clean();

			header('Content-type: text/xml');
			echo "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n";
			echo "<markers>\n";

			foreach ($this->_users as $user) {
				foreach ($user as $key=>$value) {
					$user[$key] = htmlspecialchars($value,ENT_QUOTES,'UTF-8');
				}
				$profile_url = JRoute::_('index.php?option=com_agora&task=profile&user_id=' . $user['id']);
				
				echo "\t<marker".
					" id=\"{$user['id']}\"".
					" username=\"{$user['username']}\"".
					" title=\"{$user['title']}\"".
					" url=\"{$user['url']}\"".
					" location=\"{$user['location']}\"".
					" lat=\"{$user['latitude']}\"".
					" lng=\"{$user['longitude']}\"".
					" useavatar=\"{$user['use_avatar']}\"".
					" profile_url=\"{$profile_url}\"".
					" avatar=\"{$user['avatar_field']}\" /> \n";
			}

			echo '</markers>';
			die;
		}
	}
?>
